<?
	// Listado
	$aColor = traer_colores();
	 require_once('inc/componentes/nusoap/nusoap.php');
	 $wsdl='http://10.10.1.83/apps/contenido/ws/ws.mailist.php';
	 $client=new soap_client($wsdl, 'wsdl');
	
	// Arma la matrix
		$oPaging = new Paging( $this->aDatos[$cTemplateId][cThisUrl] . $this->aDatos[$cTemplateId][cThisUrlParametros] . "&amp;tr=" . $this->getTarget(), 'agenda', 10);
		$oPaging->setTotalItems ( $this->aDatos[$cTemplateId][nqResultados]);

		$ncUsuario = $this->oUserSession->getUser();
		if ( $ncUsuario ) 
		{
			$aMapId = array( 1 => 103,2 => 63, 3 => 108, 4 => 827, 5 => 746, 6 => 949);
			$email = $this->oDatabase->getData("SELECT cEmail FROM gtUsuario WHERE ncUsuario = $ncUsuario");
			$cSql = 'SELECT a.ncGacetilla, a.cdGacetilla, a.cContenido FROM gtGacetilla  as a';			
			$aGacetillas = $this->oDatabase->getMatrix($cSql  . $oPaging->getOrderBy() , $oPaging->getFrom(), $oPaging->getLength());
?>
	<div id="gacetillas">
		<div id="modos" style="margin-top: 10px; overflow: hidden;">
			<div style="padding: 10px">
				<?
					$nCont = $oPaging->getFrom() +  1;
					foreach ( $aGacetillas as $aGacetilla )
					{
						//Array ( [0] => Array ( [pendiente_id] => 204554 [suscriptor_nombre] => ZULLY [suscriptor_apellido] => goldfarb [suscriptor_direccion] => zully@zully.com.ar [suscriptor_clave] => [suscriptor_formato] => 1 [lista_id] => 67 [estado] => 2 [verificacion] => 15 [fecha] => 2009-02-20 ) ) Array ( )						
						$aSuscripto = $client->call('ExistUsers', array('buscar' => $email, 'lista_id' => $aMapId[$aGacetilla[ncGacetilla] ] )  );
						echo "	<div style='overflow:auto; padding:10px 5px; border-bottom:2px solid #cccccc'>
									<!--<div style='float:left; width:13px;'><div style='width:8px; height:8px; margin-top:4px; background:#$aColor[$nCont]'></div></div>-->
									<div style='float:left; margin-left:4px; width:300px'>
										<div class='titulo'>". extractLanguage($aGacetilla[cdGacetilla], $this->getLanguage() ) ."</div>
										<div class='descr'>". extractLanguage($aGacetilla[cContenido], $this->getLanguage() ) ."</div>
									</div>";
							if ( $aSuscripto[0][suscriptor_direccion] == $email ) 
								echo "<div id='item_$aGacetilla[ncGacetilla]' style='float:right; margin-left:4px; padding-top:12px;'>
										<div class='div_boton_cancelar_largo'><a style='color:#ffffff;text-transform:capitalize;' href='javascript://void(0);' onclick=\"send('?mo=clientes&amp;ac=mis_gacetillas&amp;fn=desuscribir&amp;rf=action&amp;ncGacetilla=". $aGacetilla[ncGacetilla] ."' , refreshElement, 'item_$aGacetilla[ncGacetilla]'); return false;\">". mostrar_termino('LBL_Desuscribirme')  ."</a></div>
									</div>";
							else
								echo "<div id='item_$aGacetilla[ncGacetilla]' style='float:right; margin-left:4px; padding-top:12px;'>
										<div class='div_boton'><a style='color:#ffffff;text-transform:capitalize;' href='javascript://void(0);' onclick=\"send('?mo=clientes&amp;ac=mis_gacetillas&amp;fn=suscribir&amp;rf=action&amp;ncGacetilla=". $aGacetilla[ncGacetilla] ."' , refreshElement, 'item_$aGacetilla[ncGacetilla]'); return false;\">". mostrar_termino('LBL_suscribirme')  ."</a></div>
									</div>";
						echo "	</div>";
						$nCont++;
					}
				?>
			</div>
		</div>
	</div>
<? } ?>